<template>
  <div>
    <m-header :title="iNowTitle"></m-header>
    <div class="customer">
      <div class="account">
        <div class="account_form">
          <div class="account_line">
            <div class="account_title">银行卡号:</div>
            <div class="account_detail" id="account_no" v-html="account_no"></div>
          </div>
          <div class="account_line">
            <div class="account_title">银行名称:</div>
            <div class="account_detail" id="account_bank" v-html="account_bank"></div>
          </div>
          <div class="account_line">
            <div class="account_title">收款人:</div>
            <div class="account_detail" id="account_name" v-html="account_name"></div>
          </div>

        </div>
        <div class="tips">
          <p>*首次申请提取返利金额，需要绑定银行卡账号  </p>
          <p>*仅限个人账户，再次提交默认修改原来提交的账号信息  </p>
        </div>
      </div>
    </div>
    <router-link class="btn_big bind_big_btn" tag="a" to="/toSetCashAccount">修改提现账号</router-link>
  </div>
</template>

<script type="text/ecmascript-6">
  import MHeader from 'base/m-header/m-header'
  import {ERR_OK} from 'config/config'

  export default {
    data() {
      return {
        iNowTitle: '设置提现账号',
        account_no: '',
        account_bank: [],
        account_name: '',
      }
    },
    created() {
      this.getBankAccount()
    },
    methods: {
      getBankAccount() {
        this.$http({
          method: 'post',
          url: '/mobile/api/v1.0/channelAgent/getBankAccount'
        }).then((res) => {
          if (res.data.code == ERR_OK) {
            this.account_no = res.data.data.account_no;//银行卡号
            this.account_bank = res.data.data.account_bank;//银行名称
            this.account_name = res.data.data.account_name;//收款人姓名
          }
        }).catch((err) => {
          console.log(err)
        })
      }
    },
    components: {
      MHeader
    }
  }

</script>

<style lang="less" rel="stylesheet/less" scoped>
  input, select {
    border: 1px solid #dfdfdf !important
  }

  .account_line {
    margin-bottom: 0.4rem;
  }
</style>
